﻿using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Dryricenet
{
    public partial class ph_Evaluation : System.Web.UI.Page
    {
        public int id = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            string name = Session["Name"].ToString();
            DataTable dt = userBLL.selectNameBll(name);
            DataRow dr = dt.Rows[0];//第一条数据
            id = Convert.ToInt32(dr["UserID"]);
            if (!IsPostBack)
            {
                Refresh(id);
            }
        }
        //刷新
        public void Refresh(int id)
        {
            GridView1.DataSource = AppraiseBLL.backstagePLCKBLL(id);
            GridView1.DataBind();
        }
        //删除
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            int id1 = int.Parse((sender as LinkButton).CssClass);
            AppraiseBLL.plSCBLL(id);
            Refresh(id);
        }
        //分页
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            Refresh(id);
        }
    }
}